<!--
 * @Author: your name
 * @Date: 2022-03-21 09:47:13
 * @LastEditTime: 2022-03-21 22:23:58
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \算法测试\day0906\3.21.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [1,2,3,4]
        arr.forEach((item,index,all) => {
            console.log(item+'-'+index+'-'+all);
        });
        arr.join("");
        console.log(arr);

        function foo() {
            console.log(this.a);
            this.a = 123;
        }
        foo.prototype.a = 456;
        console.log(new foo());

        function Person() {
            
        }
        Person._name ="123"
        let b = new Person();
        Person.prototype._name = '5555'
        b._name ="456";
        console.log(Person._name,b._name,Person.prototype._name);

        let arr1 = [56,767,234,123,22];
        let result = arr1.reduce((total,num)=>{return total+num},0);
        console.log(arr1);
        console.log(result);
    </script>
</body>
</html>